package app.blog.entity;

import java.util.Date;
import java.util.List;

import slap.berkeleydb.BDB;

import app.blog.Blog;

import com.sleepycat.persist.PrimaryIndex;
import com.sleepycat.persist.SecondaryIndex;
import com.sleepycat.persist.model.NotPersistent;
import com.sleepycat.persist.model.Persistent;
import com.sleepycat.persist.model.PrimaryKey;
import com.sleepycat.persist.model.Relationship;
import com.sleepycat.persist.model.SecondaryKey;


@Persistent
public class Post {
	
	@PrimaryKey(sequence = "post-id")
	public Integer id;
	
	@SecondaryKey(relate = Relationship.ONE_TO_ONE)
	public String name;
	
	@SecondaryKey(relate = Relationship.ONE_TO_ONE)
	public String title;
	
	@NotPersistent
	public transient User author;
	
	@SecondaryKey(relate = Relationship.ONE_TO_ONE)
	public Date pubDate;
	
	@SecondaryKey(relate = Relationship.MANY_TO_ONE)
	public long view;
	
}
